<include file="Public:header" />
<div class="container">
	<div class="page-header">
		<h4>{:L('SYSTEM_SETTING')}</h4>
	</div>
	<include file="Public:alert" />	
	<div class="tabbable">
		<ul class="nav nav-tabs">
			<li><a href="{:U('setting/smtp')}">{:L('SMTP_SETTING')}</a></li>
			<li><a href="{:U('navigation/setting')}">{:L('SYSTEM_NAVIGATION_SETTING')}</a></li>
			<li><a href="{:U('product/category')}">{:L('PRODUCT_CATEGORY_SETTINGS')}</a></li>
			<li><a href="{:U('knowledge/category')}">{:L('KNOWLEDGE_CLASSIFICATION_SET')}</a></li>
			<li><a href="{:U('setting/status')}">{:L('BUSINESS_TO_THE_STATE')}</a></li>
			<li class="active"><a href="{:U('setting/statusflow')}">{:L('BUSINESS_STATE_FLOW_SETTINGS')}</a></li>
		</ul>
	</div>
	<div class="row">
	<form id="form1" action="{:U('setting/statusflowDelete')}" method="post">
		<div class="span12">
			<p><div class="bulk-actions align-left">
				<input type="submit" class="btn" value="{:L('DELETE')}"/>&nbsp; <a class="btn" id="set_default" href="javascript:void(0)"/>{:L('SET_TO_THE_CURRENT')}</a>
				<div class="pull-right">
					<a class="btn btn-primary" id="add">{:L('ADD_STATE_OF_FLOW')}</a>
				</div>
			</div></p>
		</div>
		<div class="span12">
			<table class="table" width="95%" border="0" cellspacing="1" cellpadding="0">
				<notempty name="flowList">
				<thead>
					<tr>
						<th width="10%"><input type="checkbox" name="check_all" id="check_all" class="check_all"/> &nbsp;</th>
						<th width="30%">{:L('STATE_OF_FLOW')}</th>
						<th width="40%">{:L('STATE_FLOW_DESCRIPTION')}</th>
						<th width="20%">{:L('OPERATING')}</th>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="6">
							{$page}
						</td>
					</tr>
				</tfoot>
				<tbody>
					<volist name="flowList" id="vo">
						<tr>
							<td><input type="checkbox" class="list" name="flow_id[]" value="{$vo.flow_id}"/>
							</td>
							<td>{$vo.name}</td>
							<td>{$vo.description}</td>
							<td><a class="edit" href="javascript:void(0)" rel="{$vo.flow_id}">{:L('EDIT')}</a></td>
						</tr>
					</volist>
				</tbody>
				<else />
					<tr>
						<td>{:L('EMPTY_TPL_DATA')}</td>
					</tr>
				</notempty>
			</table>
		</div> 
	</form>
	</div>
</div>
<div class="hide" id="dialog-add" title="{:L('ADD_STATE_OF_FLOW')}">loading...</div>
<div class="hide" id="dialog-edit" title="{:L('CHANGE_STATE_OF_FLOW')}">loading...</div>
<script type="text/javascript">	
$("#dialog-add").dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	position: ["center",100]
});
$("#dialog-edit").dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	position: ["center",100]
});
$(function(){
	$("#check_all").click(function(){
		$("input[class='list']").prop('checked', $(this).prop("checked"));
	});
	$("#add").click(function(){
		$('#dialog-add').dialog('open');
		$('#dialog-add').load('{:U("setting/statusflowadd")}');
	});
	$("#set_default").click(function(){
		window.location="{:U('setting/use_flow','flow_id=')}"+id;
	});
	$(".edit").click(function(){
		var id = $(this).attr('rel');
		$('#dialog-edit').dialog('open');
		$('#dialog-edit').load('{:U("setting/statusflowEdit","id")}'+id);
	});
})
</script>
<include file="Public:footer" />